package xyz.yhsj.kmusic

import khttp.post
import xyz.yhsj.kmusic.utils.AESCryptUtil


object NetEase {

    inline fun <reified T> test() {

        val resp = post(
            url = "https://interface.music.163.com/eapi/album/v3/detail?cache_key=bW7%2FymHrM%2Bki380t2fuEALFwQLwYBZlwQBUIP01OOP0%3D",
            data = mapOf(
                "params" to
                        "9A53041E0B7D7E697E6F7ADF95BC257B058D9E4FFF7B271404116A3A69A76C262089FDFBBDC786A5DCDB5A11D13E48EF676346FE0B02D8086778A62975DA029A90E284D1EF6AA8FA7C29D25700E8236498F518D6075C9A33AA6EA402D5DA93DB0308365E5323F84AAA9E24D3DC1123530E9BE6263C132D6114D828739FA404FE6044A9D7F1E1152446C1691676E5E0A67B380631B39DA89D52B320CBCC66AD552FA5D95BA39BF5BC55B3819957D60393133C164766ADB56B1D1395BCA7D361459A9C250A7064F68892BF616FE25A5E650122926C9C62BDE7B00934D4E6EE5467D2BC8A49C7BBA8F3563F6FC25953B1D95C01318CE3CDF75C4E338DD84574D22AF228C1133F4BA75D2E2DCE28D124D2A7D027B64C8E7E0B183EC5DDC38CDBCF83402A2EA792E79FCE1C70213A99F96A96513A3ACBF64D8F4443FDF3F6EC08699946E0AE2CBF42740B5F94B8266D9D3659C96BFBA7C2A1ADAAF0387D265FA015F5862E675EA6F99025E8361F9FFB9ABED5C2D57E6B6EB23434B82D9085E048C4A0A903ACF28E7874E7201E52415F14A6F7BEC047D37836747551A3E07EC1FA4D56F56471A51609CC97C129064524201571FAA6F1D4FE6BAA7567B92995C259925622FB0E518B10E911E144E98041A6E6B62CE0D774AB8110CEF7FFDA7D2EB3C14CC84B6EF3ED2533EA5849C47634780945366EC6D547338955F27B59EA9A97EF245F6E39F49FA9B9AA8F06E92E611DE6794DAB6E1A1E80F994AA4501B12D08DF790747C505E3EAE4432612954619557FA41DAF757D4364F429E29AD61C56F4905565545C898DE86C59AFC7E42D018076C6E67D71D328024673078AB4DD5D88B1136C7F3BB856AFDB740E8F65A7FD25134F790DA0233B18155EB5CD843D0FA1C2EAC070649D6679BD1DE23AD4AAE7DCB6D05FC0CD18CC286EC752B1D073A91C5E9BC761BD2345C5D66ABC292056757B40D46F7AE93CF1704DA1936B297F797D61791295FC04E4D848F7EAEE3C08D700B0B0"
            ),
            headers = mapOf(
                "Host" to "interface.music.163.com",
                "Connection" to "keep-alive",
                "Accept" to "*/*",
                "MConfig-Info" to "{\"IuRPVVmc3WWul9fT\":{\"version\":71,\"appver\":\"2.7.5.198554\"}}",
                "MG-Product-Name" to "music",
                "Origin" to "orpheus://orpheus",
                "User-Agent" to "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.157 NeteaseMusicDesktop/2.7.5.198554 Safari/537.36",
                "Accept-Encoding" to "gzip,deflate",
                "Accept-Language" to "en-us,en;q=0.8",
                "Cookie" to "os=pc; deviceId=57ACA9B887376DD472B70E581DD229810A9A1F7F94C69159EFDD; osver=Microsoft-Windows-10-Professional-build-19042-64bit; appver=2.7.5.198554; channel=netease; MUSIC_A=1dd6cb9b39bf396602e03e5eb0b456f10727094f7405cb8641891fc79301ca165d61f04027b95b731f2286c0ba5a42bcde3cff74b6916c23ec58efb075f2174d88664b3c3683097c3125d5552ad44d386c0b02903764249b; NMTID=00OrJ5HLxhAFdUT0UBwmXoYaU4fq-UAAAF12oiHBQ; __csrf=1b8ef095b1a997ab499544379db89b94; mode=Veriton%20D430; ntes_kaola_ad=1"

            )
        )
        println(AESCryptUtil.decrypt(resp.content, "e82ckenh8dichen8", "0102030405060708"))


    }


}

suspend fun main() {

    NetEase.test<ByteArray>()


}